package cate.game.role.pvp.arena.msg;

import cate.game.client.msg.ClientMsg;
import cate.game.client.msg.MsgConfig;
import cate.game.client.msg.MsgOutput;
import cate.game.client.msg.id.MsgIdBArena;
import cate.game.pvp.arena.core.ArenaFightRecord;
import cate.game.pvp.arena.core.ArenaRoleSnapshot;
import cate.game.role.pvp.arena.RoleArena;
import easy.java.dev.note.NoteField;
import lombok.NoArgsConstructor;

import java.util.List;
import java.util.Map;

@NoArgsConstructor
@ClientMsg(title = "跨服擂台赛-信息 返回")
public class ArenaInfoResp implements MsgOutput {
    @NoteField("我的排行")
    public int rank;
    @NoteField("我的积分")
    public int score;
    @NoteField("已用的免费次数")
    public int freeTimeUsed;
    @NoteField("今日挑战次数")
    public int dailyFightNum;
    @NoteField("每日挑战奖励领取状态")
    public Map<Integer, Boolean> dailyFightRewards;
    @NoteField("是否跳过战斗")
    public boolean skipFight;
    @NoteField("点赞已使用次数")
    public int likeTimeUsed;
    @NoteField("点赞过的玩家UID")
    public List<String> likeUIds;
    @NoteField("上次对手刷新时间")
    public long lastOpponentRefreshTime;
    @NoteField("对手列表")
    public List<ArenaRoleSnapshot> opponents;
    @NoteField("防守视野")
    public List<Boolean> defendVisions;
    @NoteField("战报列表")
    public List<ArenaFightRecord> records;

    @Override
    public MsgConfig conf() {
        return MsgIdBArena.INFO_RESP;
    }

    public ArenaInfoResp(RoleArena info) {
        rank = info.rank;
        score = info.score;
        freeTimeUsed = info.freeTimeUsed;
        dailyFightNum = info.dailyFightNum;
        dailyFightRewards = info.dailyFightRewards;
        skipFight = info.skipFight;
        likeTimeUsed = info.likeTimeUsed;
        likeUIds = info.likeUIds;
        lastOpponentRefreshTime = info.lastOpponentRefreshTime;
        opponents = info.opponents;
        defendVisions = info.defendVisions;
        records = info.records;
    }
}
